#include "CNode.h"

CNode::CNode(unsigned int X, unsigned int Y, unsigned int Width, unsigned int Height, NodeType Type)
{
	IsPath = 0;
	Parent = NULL;

    _X = X;
    _Y = Y;

    _Width = Width;
    _Height = Height;

    _Type = Type;

    NodeRectangle = new Rectangle(Width, Height, X * Width, Y * Height);
}

CNode::~CNode()							{}

void CNode::Draw(SDL_Surface* Screen)
{
    switch(_Type)
    {
    case(GROUND):
    		if(IsPath > 0) NodeRectangle->Fill(Screen, 255, 140, 0);
			if(IsPath == 0) NodeRectangle->Fill(Screen, 200, 200, 200);
    		break;
    case(WALL):
    		NodeRectangle->Fill(Screen, 0, 0, 0);
    		break;
    case(START):
    		NodeRectangle->Fill(Screen, 0, 255, 0);
    		break;
    case(END):
    		NodeRectangle->Fill(Screen, 255, 0, 0);
    		break;
    }

	NodeRectangle->Blit(Screen);
}
